-- stack: in.5 -- format: 8 (HyperCard 1) -- flags: 0x1000 (none) -- protect password hash: 0 -- maximum user level: 5 (scripting) -- window: Rect(x1=0, y1=0, x2=0, y2=0) -- screen: Rect(x1=0, y1=0, x2=0, y2=0) -- card dimensions: w=0 h=0 -- scroll: x=0 y=0 -- background count: 3 -- first background id: 2765 -- card count: 12 -- first card id: 2966 -- list block id: 7899 -- print block id: 0 -- font table block id: 0 -- style table block id: 0 -- free block count: 0 -- free size: 0 bytes -- total size: 40768 bytes -- stack block size: 8704 bytes -- created by hypercard version: 0x00000000 -- compacted by hypercard version: 0x01208000 -- modified by hypercard version: 0x01208000 -- opened by hypercard version: 0x01208000 -- patterns[0]: 0x0000000000000000 -- patterns[1]: 0x8000000008000000 -- patterns[2]: 0x8800220088002200 -- patterns[3]: 0x8888222288882222 -- patterns[4]: 0x88AA22AA88AA22AA -- patterns[5]: 0xCCAA33AACCAA33AA -- patterns[6]: 0xEEAABBAAEEAABBAA -- patterns[7]: 0xEEBBBBEEEEBBBBEE -- patterns[8]: 0xFFBBFFEEFFBBFFEE -- patterns[9]: 0xFFBBFFFFFFBBFFFF -- patterns[10]: 0x8010022001084004 -- patterns[11]: 0xFFFFFFFFFFFFFFFF -- patterns[12]: 0x8822882288228822 -- patterns[13]: 0x1122448811224488 -- patterns[14]: 0xC4800C6843023026 -- patterns[15]: 0xB130031BD8C00C8D -- patterns[16]: 0xAA00AA00AA00AA00 -- patterns[17]: 0x8822552288225522 -- patterns[18]: 0x8855225588552255 -- patterns[19]: 0x77DD77DD77DD77DD -- patterns[20]: 0x8000000000000000 -- patterns[21]: 0xAA55AA55AA55AA55 -- patterns[22]: 0x038448300C020101 -- patterns[23]: 0x8244394482010101 -- patterns[24]: 0x8814224188412214 -- patterns[25]: 0x8080413E080814E3 -- patterns[26]: 0x22048C7422179810 -- patterns[27]: 0xBE808808EB088880 -- patterns[28]: 0x25C8328964244C92 -- patterns[29]: 0xA29C41BE2AC914EB -- patterns[30]: 0x40A00000040A0000 -- patterns[31]: 0x8040200002040800 -- patterns[32]: 0xAA00800088008000 -- patterns[33]: 0xFF80808080808080 -- patterns[34]: 0x081C22C180010204 -- patterns[35]: 0xFF808080FF080808 -- patterns[36]: 0xF87422478F172271 -- patterns[37]: 0xBF00BFBFB0B0B0B0 -- patterns[38]: 0xFF7FBE5DA2418000 -- patterns[39]: 0xFAF5FAF5A050A050 -- checksum: 0x0 ----- HyperTalk script ----- on openStack global val,force put 0 into force hide message box hide field rem put the seconds/86400 + 16480.5 + 5/24 into jd2 put trunc(jd2+24000000) +1 into jd get the date convert it to dateItems put item 2 of it into m put item 3 of it into d put false into val if m>4 and m<=10 then put true into val put trunc(jd-7*trunc(jd/7)) into w if m=4 and d>w then put true into val if m=10 and (d-w)>=25 then put false into val push card if the number of this cd is 1 then put line 2 of card field "Algol" into ecl repeat if ecl > jd2 then exit repeat add 2.8673075 to ecl end repeat set numberFormat to "0.0" put "Next minimum of Algol occurs in" && (ecl-jd2)*24 && "hours at JD=" into line 1 of card field Algol set numberFormat to "0.###" put ecl+2400000 after line 1 of card field Algol put ecl into line 2 of card field Algol end if set numberFormat to "0.######" end openStack function TJDDate get the seconds add 86400+3600*(12+DSTcheck()) to it convert it to long date put char 1 to (offset(",",third word of it)-1) of third word of it && second word of it && last word of it into he return he end TJDDate function getDate get the long date put char 1 to (offset(",",third word of it)-1) of third word of it && second word of it && last word of it into he return he end getDate function getJDDate get the seconds add 3600*(12+DSTcheck()) to it convert it to long date put char 1 to (offset(",",third word of it)-1) of third word of it && second word of it && last word of it into he return he end getJDDate function getUTDate get the seconds add 3600*(DSTcheck()) to it convert it to long date put char 1 to (offset(",",third word of it)-1) of third word of it && second word of it && last word of it into he return he end getUTDate function DSTcheck get first word of line 4 of card field Coords of first cd if hilite of bkgnd button "DST" then put it-1 into temp else put it into temp return temp end DSTcheck on dayOfYear -- returns day, dayUT as number of day in year global dayUT,day,daySecs put the date into daySecs convert daySecs to seconds put number of chars of the date into ndate put "12/31/" & (char ndate-1 to ndate of the date)-1 into Jan0 convert Jan0 to seconds put (daySecs-Jan0)/86400 into day put (daySecs-Jan0+3600*DSTcheck())/86400 into dayUT end dayOfYear on cheb a,b,c global x,xa,xb put 2*x*a-b+c into temp put a into xb put temp into xa end cheb on UT global day,daySecs,x,xa,xb,m dayOfYear -- gets daySecs get ((the seconds-daySecs)/3600+DSTcheck())mod 24 put trunc(it) into h put trunc(60*(it-h)) into m if m<10 then put "0" before m put "Universal Time = "& h &":" & m into line 1 of field 1 put it into line 2 of field 1 end UT on ST global day,daySecs,x,xa,xb,dayUT dayOfYear -- gets day put (dayUT-1)/183-1 into x put 0 into a put 0 into b put 7 into i repeat until i=0 cheb a,b,word i+1 of card field "Sidereal Cheb" of card 1 put xa into a put xb into b subtract 1 from i end repeat put xb into b2 cheb a,b,word 1 of card field "Sidereal Cheb" of card 1 get ((xa-b2)/2+((the seconds-daySecs)/3600+DSTcheck())*1.00273791- (line 2 of card field "coords" of card 1)/15+24) mod 24 put trunc(it) into h put trunc(60*(it-h)) into m if m<10 then put "0" before m put "Sidereal Time = "& h &":" & m into line 1 of field 2 put it into line 2 of field 2 end ST on hm decv global it,h,m put trunc(it) into h put trunc(60*(it-h)) into m if decv then put abs(m) into m if m<10 then put "0" before m end hm on calc num,force set cursor to 1001 -- calcs ra and dec put pi/180 into fac global day,daySecs,x,xa,xb,dayUT,it,h,m,mode dayOfYear -- gets day,dayUT get line 3 of field 1 put fac*(line 1 of card field "Coords" of card 1) into lat if (it=trunc(dayUT) and the optionkey is up) and force=0 then put line 5 of field 5 into dra put (line 6 of field 5)*fac into dec put line 3 of field 6 into arg else set cursor to 1002 put trunc(dayUT) into line 3 of field 1 put (dayUT+((the seconds-daySecs)/3600+DSTcheck())/24-1)/183-1 into x put 0 into a put 0 into b put num into i repeat until i=0 cheb a,b,word i+1 of field 3 set cursor to busy put xa into a put xb into b subtract 1 from i end repeat put xb into b2 cheb a,b,word 1 of field 3 get ((xa-b2)/2+48) mod 24 put it*15 into dra put dra into line 5 of field 5 hm false put short name of this card &" R.A. = "& h &"h " & m &"m"into line 1 of field 5 put 0 into a put 0 into b put num into i repeat until i=0 cheb a,b,word i+1 of field 4 set cursor to busy put xa into a put xb into b subtract 1 from i end repeat put xb into b2 cheb a,b,word 1 of field 4 get (xa-b2)/2 put it*fac into dec put it into line 6 of field 5 put empty into sign if it<0 and it>-1 then put "-" into sign if it>0 then put "+" into sign hm true put short name of this card&" Dec. = "&sign&h&"° "&m&"'" into line 2 of field 5 if short name of this card is in "Sun" then get (-.2079-sin(lat)*sin(dec))/cos(lat)/cos(dec) put atan(sqrt(1-it*it)/it) into ang add pi to ang if sin(lat)*sin(dec)<0.2079 then add pi to ang end if put ang/fac/15 into delta put dra/15+(line 2 of field 1)-line 2 of field 2+24-DSTcheck() into arg get (arg-delta) mod 24 put it into line 3 of card field 1 hm false ampm put "Twilight begins at "& h &":" & m && mode into line 1 of cd fld 1 get (arg+delta) mod 24 put it into line 4 of cd fld 1 hm false ampm put "Twilight ends at "& h &":" & m && mode into line 2 of cd fld 1 end if get -sin(lat)*sin(dec)/cos(lat)/cos(dec) put atan(sqrt(1-it*it)/it) into ang if dec>0 then add pi to ang end if put ang/fac/15 into delta put dra/15+line 2 of field 1-line 2 of field 2+24-DSTcheck()into arg get (arg-delta) mod 24 put arg into line 3 of field 6 put it into line 4 of field 6 hm false ampm put short name of this card && "Rises at "& h &":" & m && mode into line 1 of field 6 get (arg+delta) mod 24 put it into line 5 of field 6 hm false ampm put short name of this card && "Sets at "& h &":" & m && mode into line 2 of field 6 end if -- calc alt and az of object put ((360+15*(line 2 of field 2)-dra) mod 360)*fac into LHA put cos(LHA)*sin(lat)-tan(dec)*cos(lat) into den get atan(sin(LHA)/den) if den>0 then get pi+it else if sin(LHA)>0 then get 2*pi+it else get it end if put round(it/fac) into temp put sin(lat)*sin(dec)+cos(lat)*cos(dec)*cos(LHA) into sina if abs(sina)<1 then get round(atan(sina/(sqrt(1-sina*sina)))/fac) if it>0 then put "Az. = "& temp into line 3 of field 5 put "Alt. = " & it into line 4 of field 5 else if temp>180 then put "W" into tem else put "E" into tem put "below " & tem & " horizon" into line 3 of field 5 put empty into line 4 of field 5 end if else beep end if set cursor to 1 end calc on ampm global h,mode if h>11 then subtract 12 from h put "PM" into mode else put "AM" into mode end if if h=0 then put 12 into h end ampm